﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using Wozuji.Logic.Users;

/// <summary>
///usermain 的摘要说明
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
//若要允许使用 ASP.NET AJAX 从脚本中调用此 Web 服务，请取消对下行的注释。 
 [System.Web.Script.Services.ScriptService]
public class usermain : System.Web.Services.WebService
{

    public usermain()
    {

        //如果使用设计的组件，请取消注释以下行 
        //InitializeComponent(); 
    }

   
    [WebMethod(Description = "data init", EnableSession = true)]
    public string initUserData()
    {
        
        Users u = new Users();
        if (u.isLogin())
        {
            string mb = u.initUserData();
            mb =  "["+mb+"]";
            if (mb != null)
            {
                return mb;
            }
            else
            {
                return "false";
            }
        }
        else
        {
            return "false";
        }
    }

    [WebMethod(Description = "updatesign", EnableSession = true)]
    public string updateSign(string sign)
    {
         Users u = new Users();
        if (sign.Length == 0)
        {
            //sign 为空
            return "90";
        }
        else if (sign.Length > 4000)
        {
            //sign 超长
            return "91";
        }
        else if (u.isLogin())
        {
            u.setMemberSign(sign);
            return "1";
        }
        else
        {
            //用户未登录
            return "0";
        }
    }

}

